package com.es.entity;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Map;
import java.util.Set;

@Data
@Document(indexName = "goods",type = "docs",shards = 1)
public class Goods {

    @Id
    @Field(type = FieldType.Keyword)
    private Long id; //skuid
    @Field(type = FieldType.Keyword,index = false)
    private String subTitle; //卖点
    @Field(type = FieldType.Keyword,index = false)
    private String skus; //sku信息的json的结构
    @Field(type = FieldType.Text,analyzer = "ik_max_word") //ik_max_word是一个分词器
    private String all; //所需要被搜索的信息,包括 标题 分类 ,品牌
    private Long brandId; //品牌的ID

    private Long categoryId; //商品第3级分类的id
    private Long createTime; //spu创建的时间
    private Set<Long> price; //价格
    private Map<String,Object> specs; //可搜索的规格参数名,value是参数值

}
